function validateBook()
{
	var messageDiv = document.getElementById('messageBook');
	var message = '';
	
	var actualDate = new Date();
	var actualYear = actualDate.getFullYear();
	var actualDay = actualDate.getDate();
	
	var bookedFor = document.getElementById('bookedFor').value;
	var monthBook = document.getElementById('monthBook').value;
	var dayBook = document.getElementById('dayBook').value;
	var yearBook = document.getElementById('yearBook').value;
	var startHourBook = document.getElementById('startHourBook').value;
	var startMinuteBook = document.getElementById('startMinuteBook').value;
	var endHourBook = document.getElementById('endHourBook').value;
	var endMinuteBook = document.getElementById('endMinuteBook').value;
	var descriptionBook = document.getElementById('descriptionBook').value;
	
	var reccuringBookYes = document.getElementById('reccuringBookYes').checked;
	var reccuringBookNo = document.getElementById('reccuringBookNo').checked;
	
	var weeklyBook = document.getElementById('weeklyBook').checked;
	var biweeklyBook = document.getElementById('bi-weeklyBook').checked;
	var monthlyBook = document.getElementById('monthlyBook').checked;
	var durationBook = document.getElementById('durationBook').value;
	
	if(document.getElementById('startPartDayBook'))
	{
		var startPartDay = document.getElementById('startPartDayBook').value;
		if(startPartDay == 'pm')
		{
			if(startHourBook != '12')
			{
				startHourBook = parseInt(startHourBook) + 12;
			}
		}
		else if(startPartDay == 'am')
		{
			if(startHourBook == '12')
			{
				startHourBook = '0';
			}
		}
	}
	
	if(document.getElementById('endPartDayBook'))
	{
		var endPartDay = document.getElementById('endPartDayBook').value;
		if(endPartDay == 'pm')
		{
			if(endHourBook != '12')
			{
				endHourBook = parseInt(endHourBook) + 12;
			}
		}
		else if(endPartDay == 'am')
		{
			if(endHourBook == '12')
			{
				endHourBook = '0';
			}
		}
	}
	var date = new Date();
	var actualTime = date.getTime();
	
	if (bookedFor && monthBook && dayBook && yearBook &&
		startHourBook && startMinuteBook && endMinuteBook &&
		endHourBook && descriptionBook)
	{
		var year = parseInt(yearBook);
		var month = parseInt(monthBook) - 1;
		var day = parseInt(dayBook);
		var hour = parseInt(startHourBook);
		var minute = parseInt(startMinuteBook);
		var requestTime = Date.UTC(year,month,day,hour,minute,1,100);
		if (actualTime < requestTime)
		{
			var endHour = parseInt(endHourBook);
			var endMinute = parseInt(endMinuteBook);
			var requestEndTime = Date.UTC(year,month,day,endHour,endMinute);
			if(requestEndTime > requestTime)
			{
				if(reccuringBookNo)
				{
					return true;;
				}
				else if(reccuringBookYes)
				{
					if (weeklyBook || biweeklyBook || monthlyBook)
					{
						if(durationBook)
						{
							if(durationBook.toString() >=2 && durationBook.toString() <=4)
							{
								return true;
							}
							else
							{
								message = '<font color="red">You enter incorrect information about count of duration for appointment.</font>';
								messageDiv.innerHTML = message;
								return false;
							}
						}
						else
						{
							message = '<font color="red">You don\'t enter count of duration for appointment.</font>';
							messageDiv.innerHTML = message;
							return false;	
						}	
					}
					else
					{
						message = '<font color="red">You don\'t choose type of occurance for appointment.</font>';
						messageDiv.innerHTML = message;
						return false;
					}
				}
			}
			else
			{
				message = '<font color="red">You enter incorrect information about start and end time of appointment.</font>';
				messageDiv.innerHTML = message;
				return false;
			}
		}
		else
		{
			message = '<font color="red">You enter incorrect information about date of appointment.</font>';
			messageDiv.innerHTML = message;
			return false;
		}
	
	}
	else
	{
		message = '<font color="red">You don\'t enter all information.</font>';
		messageDiv.innerHTML = message;
		return false;
	}	
	return false;
}


